package it.poste.il.compensatore.service.impl;

import it.poste.il.compensatore.dao.SDPRequestDao;
import it.poste.il.compensatore.entities.SDPRequest;
import it.poste.il.compensatore.service.SDPRequestService;

import java.util.List;

import org.springframework.stereotype.Service;

/**
 * Implementation of SDPRequestService.
 */
@Service("sdpRequestService")
public class SDPRequestServiceImpl implements SDPRequestService {
	
	SDPRequestDao sdpRequestDao;

	/**
	 * Take the sdp request dao.
	 * @return SDPRequestDao The sdp request dao.
	 */
	public SDPRequestDao getSdpRequestDao() {
		return sdpRequestDao;
	}

	/**
	 * Set the sdp request dao.
	 * @param sdpRequestDao The sdp request dao to set.
	 * @return void
	 */
	public void setSdpRequestDao(SDPRequestDao sdpRequestDao) {
		this.sdpRequestDao = sdpRequestDao;
	}

	/**
	 * Method that retrieve the sdp request by id.
	 * @param id Id to identify the sdp request.
	 * @return SDPRequest The entity sdp request.
	 */
	public SDPRequest retrieveByID(Long id) {
		return sdpRequestDao.loadById(id);
	}

	/**
	 * The list of all sdp request by filter.
	 * @param entityFilter The entity sdp request to use to filter.
	 * @return List The list of sdp request.
	 */
	public List<SDPRequest> loadByFilter(SDPRequest entityFilter) {
		return sdpRequestDao.loadByFilter(entityFilter);
	}

	/**
	 * Method that retrieve the sdp request by a filter.
	 * @param entityFilter The entity sdp request to use to filter.
	 * @return SDPRequest The entity sdp request.
	 */
	public SDPRequest loadByReq(SDPRequest entityFilter) {
		return sdpRequestDao.loadByReq(entityFilter);
	}

	/**
	 * The list of all sdp request by filter.
	 * @param entityFilter The entity sdp request to use to filter.
	 * @return List The list of sdp request from the last sdp request.
	 */
	public List<SDPRequest> loadLastCounter(SDPRequest entityFilter) {
		return sdpRequestDao.loadLastCounter(entityFilter);
	}

	/**
	 * The list of all sdp request.
	 * @return List The list of sdp request.
	 */
	public List<SDPRequest> retrieveAll() {
		return sdpRequestDao.loadAll();
	}

	/**
	 * Method that save the sdp request.
	 * @param sdpRequest sdp request to save.
	 * @return SDPRequest The sdp request saved.
	 */
	public SDPRequest save(SDPRequest sdpRequest) {
		return sdpRequestDao.save(sdpRequest);
	}

	/**
	 * Update the sdp request.
	 * @param sdpRequest SDPRequest to update.
	 * @return void
	 */
	public void update(SDPRequest sdpRequest) {
		sdpRequestDao.update(sdpRequest);
	}

	/**
	 * Delete the sdp request.
	 * @param sdpRequest SDPRequest to delete.
	 * @return void
	 */
	public void delete(SDPRequest sdpRequest) {
		sdpRequestDao.delete(sdpRequest);
	}
	
}
